##
# Wordpress Chinese
# VERSION 4.2.2
##


# Basic Image
FROM ubuntu

# Author
MAINTAINER Sean<sean.snow@live.com>

# Install PHP and Nginx
RUN apt-get update && apt-get install -y nginx php5 php5-common php5-fpm php-apc php5-mysql php5-gd; \ 

	# We need to add a config file for supervisor, so stop the service that was auto-started on intstall
	service supervisor stop; \

	mkdir /var/www; \
	chown -R www-data:www-data /var/www; \

	# Clean up
	apt-get clean; \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


# copy wordpress file
ADD wordpress /var/www/html
# copy nginx configuration
ADD nginx /etc/nginx
ADD supervisord.conf /etc/supervisor/supervisord.conf 
ADD	wordpress.conf /etc/supervisor/conf.d/wordpress.conf
ADD start.sh /root/start.sh

# define work dir
WORKDIR /var/www/html

VOLUME ["/var/www/html"]

EXPOSE 80

CMD ["sh","/root/start.sh"]
